package com.geektime.hello;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class String2LongDemo {
    public static void main(String[] args) {
        String size = "123.1";
        System.out.println(Long.valueOf(size.substring(0, size.indexOf("."))));

        BigDecimal length = BigDecimal.valueOf(38974368);
        BigDecimal size2 = length.divide(new BigDecimal(1024 * 1024), 2, RoundingMode.HALF_UP);
        System.out.println(size2.doubleValue());

//        System.out.println(Long.valueOf(null));
//        System.out.println(Long.parseLong(null));
//        System.out.println(null != null ? Long.parseLong(null) : null);
        System.out.println("abc".contains(null));
    }
}
